﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace DMSMT.Tool
{
    public partial class RDPAttrsFrm : Form
    {
        public RDPAttrsFrm()
        {
            InitializeComponent();
        }

        public RDPAttrsFrm(RDPSubFrm frm)
        {
            InitializeComponent();
            this.Owner = frm;
            this.tbServer.Text = frm.Server; 
            this.tbUser.Text = frm.UserName;
            this.tbPort.Text = frm.Port.ToString();
            this.tbPwd.Text = frm.Pwd;
        }

        private void RDPAttrsFrm_Load(object sender, EventArgs e)
        {

        }

        private void btCanel_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
        }

        private void btConn_Click(object sender, EventArgs e)
        {
            RDPSubFrm frm = (RDPSubFrm)this.Owner;
            frm.Server=this.tbServer.Text;
            frm.UserName=this.tbUser.Text;
            frm.Port=Convert.ToInt32(this.tbPort.Text.Trim());
            frm.Pwd = this.tbPwd.Text;
            frm.EnableCredSspSupport = cbCredSspSupport.Checked;
            this.DialogResult = DialogResult.OK;
        }
    }
}
